<script setup lang="ts">
const props = withDefaults(
  defineProps<{
    money: number
  }>(),
  {
    money: 0
  }
)
const emits = defineEmits<{
  (e: 'setMoney', n: number): void
}>()
const btnClick = () => {
  emits('setMoney', 1)
  console.log(props.money)
}
// props.money
</script>

<template>
  <button @click="btnClick">点击--</button>
  <div class="son-page">我是子组件----{{ money }}</div>
</template>

<style lang="scss" scoped></style>
